package icu.zqyhdm.blog.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import icu.zqyhdm.blog.entity.Comment;
import icu.zqyhdm.blog.vo.CommentVo;
import icu.zqyhdm.blog.vo.ReplyCountDTO;
import icu.zqyhdm.blog.vo.ReplyVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Description
 * @Author lifu
 * @Date 2021/6/22 15:29
 */
@Mapper
public interface CommentMapper extends BaseMapper<Comment> {

    //根据父评论id列表查出每个父评论的前三条回复
    List<ReplyVo> listReplies(@Param("commentIdList") List<Integer> commentIdList);

    // 根据评论id查询回复总量
    List<ReplyCountDTO> listReplyCountByCommentId(@Param("commentIdList") List<Integer> commentIdList);

    List<ReplyVo> listRepliesByCommentId(@Param("commentId") Integer commentId, @Param("current")Integer current, @Param("limit")Integer limit);

    List<CommentVo> listCommentByArticleId(@Param("articleId")Integer articleId,  @Param("current")Integer current, @Param("limit")Integer limit);
}
